#pragma once

// CDriverTreeCtrl

class CDriverTreeCtrl : public CTreeCtrl
{
	DECLARE_DYNAMIC(CDriverTreeCtrl)

public:
	CDriverTreeCtrl(CImageList* ilSmall);
	virtual ~CDriverTreeCtrl();
	
	int RefreshDriver();
	bool ExpandChildOfSelectItem(CString& childItemName);
	CString GetPathFromItem(HTREEITEM hItem);

protected:
	void AddDriveItem(LPCTSTR pszDrive);
	int AddDirectories(HTREEITEM hItem, LPCTSTR pszPath);
	bool SetButtonState (HTREEITEM hItem, LPCTSTR pszPath);

	void DeleteFirstChild (HTREEITEM hItem);
	void DeleteAllChildren (HTREEITEM hItem);
	CImageList* ilSmall;
	int floderImageIdx,floderSelectedImageIdx;
	
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void PreSubclassWindow();
	afx_msg void OnTvnItemexpanding(NMHDR *pNMHDR, LRESULT *pResult);
	DECLARE_MESSAGE_MAP()
};


